package formykwadratowe;
/*
 * proba.java
 *
 * Created on 14 marzec 2007, 19:25
 */

import java.awt.*;
import javax.swing.*;
/**
 *
 * @author  aniaef
 */
public class proba extends JFrame {
    
    public proba() {
        initComponents();
    }
   //zrobic drugi button "wprowadz dane calkowite" i rezczywiste - albo nie
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        jLabelRozmiar = new javax.swing.JLabel();
        jComboBoxRozmiar = new javax.swing.JComboBox();
        jButtonWprowadzDane = new javax.swing.JButton();

        jLabelRozmiar.setText("ROZMIAR MACIERZY");

        for(int i=1;i<101;i++)
        {
            String s=String.valueOf(i);
            jComboBoxRozmiar.addItem(s);
        }

        jButtonWprowadzDane.setText("WPROWADZ DANE");
        jButtonWprowadzDane.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonWprowadzDaneActionPerformed(evt);
            }
        });
        jButtonWprowadzDane.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jButtonWprowadzDaneKeyReleased(evt);
            }
        });

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(47, 47, 47)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jButtonWprowadzDane)
                    .add(layout.createSequentialGroup()
                        .add(jLabelRozmiar)
                        .add(29, 29, 29)
                        .add(jComboBoxRozmiar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(83, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(95, 95, 95)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabelRozmiar)
                    .add(jComboBoxRozmiar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(26, 26, 26)
                .add(jButtonWprowadzDane)
                .addContainerGap(58, Short.MAX_VALUE))
        );
        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButtonWprowadzDaneKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jButtonWprowadzDaneKeyReleased
        Integer ile=new Integer(jComboBoxRozmiar.getSelectedItem().toString());
        n=ile;
        this.setVisible(false);
        noweOkienkoMacierzy = new macierz(n);
        noweOkienkoMacierzy.setVisible(true);
    }//GEN-LAST:event_jButtonWprowadzDaneKeyReleased

    private void jButtonWprowadzDaneActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonWprowadzDaneActionPerformed
        Integer ile=new Integer(jComboBoxRozmiar.getSelectedItem().toString());
        n=ile;
        this.setVisible(false);
        noweOkienkoMacierzy = new macierz(n);
        noweOkienkoMacierzy.setVisible(true);
    }//GEN-LAST:event_jButtonWprowadzDaneActionPerformed
   
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonWprowadzDane;
    private javax.swing.JComboBox jComboBoxRozmiar;
    private javax.swing.JLabel jLabelRozmiar;
    // End of variables declaration//GEN-END:variables
    macierz noweOkienkoMacierzy;
    int n=0;
}
